import { Controller, Get, Render, Request } from '@nestjs/common';
import { AppService } from './app.service';

@Controller()
export class AppController {
  constructor(private readonly appService: AppService) {}

  @Get()
  @Render('index')
  getHello(@Request() req): Record<string, unknown> {
    console.log(req.session, '当前的session');
    console.log(req.cookies.name, '当前的cookie');
    console.log(req.signedCookies, '当前的signed cookie');
    return { name: '哈哈' };
    // return this.appService.getHello(); // 当返回 ejs 模版时，这里需要返回对象作用于ejs模版变量
  }
}
